﻿#ifndef ThreadH
#define ThreadH
//---------------------------------------------------------------------------

#include <pthread.h>

#include "datatype.h"
//---------------------------------------------------------------------------

class TThread
{
private:
    static void * ThdProc(void *lpParameter);
protected:
    bool Working;
    virtual void Execute() = 0;
public:
    TThread();
    virtual ~TThread();
    virtual void Stop();

    bool FreeOnTerminate;
    pthread_t ThreadID; //read only， don't modify it.
    int ExitCode; //线程退出代码
    int Active;
};
//---------------------------------------------------------------------------

#endif
